#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
    string bignum1,bignum2;
    int len1,len2;
    cin>>bignum1>>bignum2;
    len1=bignum1.length();
    len2=bignum2.length();
   vector<int> res1, res2;
for (char c : bignum1) {
    res1.push_back(c - '0');  
}
for (char c : bignum2) {
    res2.push_back(c - '0');
}
reverse(res1.begin(), res1.end());
reverse(res2.begin(), res2.end());
vector<int> output;
   if(bignum1>bignum2){
    for(int i=0;i<len1;i++){
        if(res1[i]>=res2[i]){
            output.push_back(res1[i]-res2[i]);
    }
    else{
        output.push_back(10+res1[i]-res2[i]);
        res1[i+1]--;
    }
    reverse(output.begin(), output.end());
   }
   int start=0;
   while(start<output.size()&&output[start]==0){
    start++;
   }
   for(int i=start;i<output.size();i++){
cout<<output[i];
   }
   return 0;
}else{
    
    int start=0;
   while(start<output.size()&&output[start]==0){
    start++;
   }
   cout<<"-";
     for(int i=start;i<output.size();i++){
cout<<output[i];
}
   return 0;
}
}

